﻿using System.Collections.Generic;
using System.Linq;

namespace AzureDiagMon.Common.Algorithms.FragmentedRanges
{
    /// <summary>
    /// Returns the last empty section or null
    /// </summary>
    public class LastFirstResolverStrategy : ResolverStrategy
    {
        #region Overrides of ResolverStrategy

        protected override IFragmentedRangeSection GetNextSectionInternal(IFragmentedRange fragmentedRange, IEnumerable<IFragmentedRangeSection> emptySections)
        {
            return emptySections.LastOrDefault();
        }

        #endregion
    }
}